#include "picturerenderwrap.h"


SinglePictureRenderWrap::SinglePictureRenderWrap(const char* file,GLfloat width,GLfloat height)
{
    m_render = 0;
    m_picture = new SinglePicture();
    m_picture->setSize(width,height);
    if(true == m_picture->loadTexture(file))
    {
        m_render = new SinglePictureRender();
        m_render->setSinglePicture(m_picture);
    }
    else
    {
        delete m_picture;
        m_picture = 0;
    }
}

SinglePictureRenderWrap::~SinglePictureRenderWrap()
{
    if(m_render){delete m_render;}
    if(m_picture){delete m_picture;}
}

void SinglePictureRenderWrap::render(GLfloat x,GLfloat y)
{
    if(m_render){m_render->render(x,y);}
}

void SinglePictureRenderWrap::update()
{
    if(m_render){m_render->update();}
}
